/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package SimpleQM.impl;

import helper.Helper;
import SimpleQM.QElement;
import SimpleQM.QoS;
import SimpleQM.QoS_disasterRecovery;
import SimpleQM.QoS_latency;
import SimpleQM.SimpleQMPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Qo Sdisaster Recovery</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link SimpleQM.impl.QoS_disasterRecoveryImpl#getRecoveryTimeObjective <em>Recovery Time Objective</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class QoS_disasterRecoveryImpl extends QoSCharacteristicImpl implements QoS_disasterRecovery {
	/**
	 * The default value of the '{@link #getRecoveryTimeObjective() <em>Recovery Time Objective</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getRecoveryTimeObjective()
	 * @generated
	 * @ordered
	 */
	protected static final int RECOVERY_TIME_OBJECTIVE_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getRecoveryTimeObjective() <em>Recovery Time Objective</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getRecoveryTimeObjective()
	 * @generated
	 * @ordered
	 */
	protected int recoveryTimeObjective = RECOVERY_TIME_OBJECTIVE_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected QoS_disasterRecoveryImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return SimpleQMPackage.Literals.QO_SDISASTER_RECOVERY;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getRecoveryTimeObjective() {
		return recoveryTimeObjective;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setRecoveryTimeObjective(int newRecoveryTimeObjective) {
		int oldRecoveryTimeObjective = recoveryTimeObjective;
		recoveryTimeObjective = newRecoveryTimeObjective;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, SimpleQMPackage.QO_SDISASTER_RECOVERY__RECOVERY_TIME_OBJECTIVE, oldRecoveryTimeObjective, recoveryTimeObjective));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Integer recoveryTimeObjective(String qElement) {
		// TODO: implement this method
		// Ensure that you remove @generated or mark it @generated NOT
		throw new UnsupportedOperationException();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case SimpleQMPackage.QO_SDISASTER_RECOVERY__RECOVERY_TIME_OBJECTIVE:
				return getRecoveryTimeObjective();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case SimpleQMPackage.QO_SDISASTER_RECOVERY__RECOVERY_TIME_OBJECTIVE:
				setRecoveryTimeObjective((Integer)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case SimpleQMPackage.QO_SDISASTER_RECOVERY__RECOVERY_TIME_OBJECTIVE:
				setRecoveryTimeObjective(RECOVERY_TIME_OBJECTIVE_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case SimpleQMPackage.QO_SDISASTER_RECOVERY__RECOVERY_TIME_OBJECTIVE:
				return recoveryTimeObjective != RECOVERY_TIME_OBJECTIVE_EDEFAULT;
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (recoveryTimeObjective: ");
		result.append(recoveryTimeObjective);
		result.append(')');
		return result.toString();
	}

} //QoS_disasterRecoveryImpl
